package net.sk.demo.service;

import net.sk.demo.api.TimeDTO;
import net.sk.demo.api.TimeService;
import org.apache.dubbo.config.annotation.DubboService;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author sk.z
 */
@DubboService
public class TimeServiceImpl implements TimeService {

    @Override
    public TimeDTO now() {
        Date now = new Date();
        TimeDTO time = new TimeDTO();
        time.setFormatTime(new SimpleDateFormat("yyyyMMdd HH:mm:ss").format(now));
        time.setTime(now);
        return time;
    }

}
